#include "bbAccount.h"

// Mozilla Includes
#include <nsStringGlue.h>

NS_IMPL_ISUPPORTS1(bbAccount, bbIAccount)

bbAccount::bbAccount() :
  mId(0),
  mName(NS_LITERAL_STRING("Unknown")),
  mType(NS_LITERAL_STRING("income")),
  mBalance(0.00)
{
}

bbAccount::~bbAccount()
{
}

/* attribute unsigned int id; */
NS_IMETHODIMP
bbAccount::GetId(PRUint32 *aId)
{
  NS_ENSURE_ARG_POINTER(aId);
  *aId = mId;
  return NS_OK;
}

/* attribute unsigned int id; */
NS_IMETHODIMP
bbAccount::SetId(PRUint32 aId)
{
  mId = aId;
  return NS_OK;
}

/* attribute AString name; */
NS_IMETHODIMP
bbAccount::GetName(nsAString& aName)
{
  aName = mName;
  return NS_OK;
}

/* attribute AString name; */
NS_IMETHODIMP
bbAccount::SetName(const nsAString & aName)
{
  mName = aName;
  return NS_OK;
}

/* attribute AString type; */
NS_IMETHODIMP
bbAccount::GetType(nsAString& aType)
{
  aType = mType;
  return NS_OK;
}

/* attribute AString type; */
NS_IMETHODIMP
bbAccount::SetType(const nsAString & aType)
{
  mType = aType;
  return NS_OK;
}

/* attribute double balance; */
NS_IMETHODIMP
bbAccount::GetBalance(double *aBalance)
{
  NS_ENSURE_ARG_POINTER(aBalance);
  *aBalance = mBalance;
  return NS_OK;
}

/* attribute double balance; */
NS_IMETHODIMP
bbAccount::SetBalance(double aBalance)
{
  mBalance = aBalance;
  return NS_OK;
}
